package com.fanco.learn_datastruct_leetcode.designpattern.decorator;

/**
 * @author qiaowang 2022/2/14
 * 描述
 */
public class Decorator extends Drink {

    private Drink obj;

    public Decorator(Drink drink) {
        this.obj = drink;
    }

    @Override
    public float cost() {
        // 自己的价格
        return super.getPrice() + obj.cost();
    }

    @Override
    public String getDes() {
        return super.getDes() + " " + super.getPrice() + " && " + obj.getDes();
    }
}
